home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / Snippets / Interapplication Communication / FinderOpenSelection / FinderOpenSel.r < prev    next >
Encoding:
Text File  |  1995-02-09  |  10.8 KB  |  389 lines  |  [TEXT/MPS ]

  1. #include "types.r"
  2. resource 'MENU' (131) {
  3.     131,
  4.     textMenuProc,
  5.     0x7FFFFFD7,
  6.     enabled,
  7.     "Test Stuff",
  8.     {    /* array: 3 elements */
  9.         /* [1] */
  10.         "Launch a local file", noIcon, noKey, noMark, plain,
  11.         /* [2] */
  12.         "Open a local Finder window", noIcon, noKey, noMark, plain,
  13.         /* [3] */
  14.         "Launch a remote file", noIcon, noKey, noMark, plain
  15.     }
  16. };
  17.  
  18. resource 'MENU' (128, preload) {
  19.     128,
  20.     textMenuProc,
  21.     0x7FFFFFFD,
  22.     enabled,
  23.     apple,
  24.     {    /* array: 2 elements */
  25.         /* [1] */
  26.         "About", noIcon, noKey, noMark, plain,
  27.         /* [2] */
  28.         "-", noIcon, noKey, noMark, plain
  29.     }
  30. };
  31.  
  32. resource 'MENU' (129, preload) {
  33.     129,
  34.     textMenuProc,
  35.     0xE00,
  36.     enabled,
  37.     "File",
  38.     {    /* array: 10 elements */
  39.         /* [1] */
  40.         "New", noIcon, "N", noMark, plain,
  41.         /* [2] */
  42.         "Open", noIcon, "O", noMark, plain,
  43.         /* [3] */
  44.         "Close", noIcon, "W", noMark, plain,
  45.         /* [4] */
  46.         "Save", noIcon, "S", noMark, plain,
  47.         /* [5] */
  48.         "Save As...", noIcon, noKey, noMark, plain,
  49.         /* [6] */
  50.         "-", noIcon, noKey, noMark, plain,
  51.         /* [7] */
  52.         "Page Setup...", noIcon, noKey, noMark, plain,
  53.         /* [8] */
  54.         "Print...", noIcon, "P", noMark, plain,
  55.         /* [9] */
  56.         "-", noIcon, noKey, noMark, plain,
  57.         /* [10] */
  58.         "Quit", noIcon, "Q", noMark, plain
  59.     }
  60. };
  61.  
  62. resource 'MENU' (130, preload) {
  63.     130,
  64.     textMenuProc,
  65.     0x3400,
  66.     enabled,
  67.     "Edit",
  68.     {    /* array: 6 elements */
  69.         /* [1] */
  70.         "Undo", noIcon, "Z", noMark, plain,
  71.         /* [2] */
  72.         "-", noIcon, noKey, noMark, plain,
  73.         /* [3] */
  74.         "Cut", noIcon, "X", noMark, plain,
  75.         /* [4] */
  76.         "Copy", noIcon, "C", noMark, plain,
  77.         /* [5] */
  78.         "Paste", noIcon, "V", noMark, plain,
  79.         /* [6] */
  80.         "Clear", noIcon, noKey, noMark, plain
  81.     }
  82. };
  83.  
  84. resource 'DITL' (128, purgeable) {
  85.     {    /* array DITLarray: 4 elements */
  86.         /* [1] */
  87.         {164, 115, 184, 185},
  88.         Button {
  89.             enabled,
  90.             "OK"
  91.         },
  92.         /* [2] */
  93.         {0, 10, 70, 287},
  94.         StaticText {
  95.             disabled,
  96.             "FinderOpenSel 1.0.1\n\nDemonstrates using "
  97.             "Finder OpenSelection events"
  98.         },
  99.         /* [3] */
  100.         {76, 3, 154, 301},
  101.         StaticText {
  102.             disabled,
  103.             "FredWare from Apple Developer Technical "
  104.             "Support, ADS group.\nCopyright ©  1991 - "
  105.             "1992 Apple Computer Inc.\nWritten by C.K."
  106.             " Haun <TR>."
  107.         },
  108.         /* [4] */
  109.         {10, 290, 42, 322},
  110.         Icon {
  111.             disabled,
  112.             129
  113.         }
  114.     }
  115. };
  116.  
  117. resource 'DITL' (129, purgeable) {
  118.     {    /* array DITLarray: 2 elements */
  119.         /* [1] */
  120.         {170, 90, 190, 148},
  121.         Button {
  122.             enabled,
  123.             "OK"
  124.         },
  125.         /* [2] */
  126.         {10, 40, 62, 204},
  127.         StaticText {
  128.             disabled,
  129.             "Help information should go here"
  130.         }
  131.     }
  132. };
  133.  
  134. resource 'DITL' (130, purgeable) {
  135.     {    /* array DITLarray: 3 elements */
  136.         /* [1] */
  137.         {80, 100, 100, 158},
  138.         Button {
  139.             enabled,
  140.             "Exit"
  141.         },
  142.         /* [2] */
  143.         {10, 80, 27, 237},
  144.         StaticText {
  145.             disabled,
  146.             "Bad System Version!"
  147.         },
  148.         /* [3] */
  149.         {50, 25, 66, 232},
  150.         StaticText {
  151.             disabled,
  152.             "Requires System 7 or greater."
  153.         }
  154.     }
  155. };
  156.  
  157. resource 'DITL' (131) {
  158.     {    /* array DITLarray: 4 elements */
  159.         /* [1] */
  160.         {110, 370, 130, 428},
  161.         Button {
  162.             enabled,
  163.             "OK"
  164.         },
  165.         /* [2] */
  166.         {110, 300, 130, 358},
  167.         Button {
  168.             enabled,
  169.             "Cancel"
  170.         },
  171.         /* [3] */
  172.         {10, 40, 41, 385},
  173.         StaticText {
  174.             disabled,
  175.             "Enter full path to file you want to laun"
  176.             "ch remotely (i.e. HD80:MPW:MPW Shell)"
  177.         },
  178.         /* [4] */
  179.         {50, 30, 88, 388},
  180.         EditText {
  181.             enabled,
  182.             ""
  183.         }
  184.     }
  185. };
  186.  
  187. resource 'ALRT' (128, purgeable) {
  188.     {40, 40, 227, 387},
  189.     128,
  190.     {    /* array: 4 elements */
  191.         /* [1] */
  192.         OK, visible, silent,
  193.         /* [2] */
  194.         OK, visible, silent,
  195.         /* [3] */
  196.         OK, visible, silent,
  197.         /* [4] */
  198.         OK, visible, silent
  199.     }
  200. };
  201.  
  202. resource 'ALRT' (130, purgeable) {
  203.     {40, 40, 149, 296},
  204.     130,
  205.     {    /* array: 4 elements */
  206.         /* [1] */
  207.         OK, visible, sound1,
  208.         /* [2] */
  209.         OK, visible, sound1,
  210.         /* [3] */
  211.         OK, visible, sound1,
  212.         /* [4] */
  213.         OK, visible, sound1
  214.     }
  215. };
  216.  
  217. resource 'DLOG' (129, "Sample Help Dialog", purgeable) {
  218.     {34, 40, 234, 280},
  219.     dBoxProc,
  220.     visible,
  221.     goAway,
  222.     0x0,
  223.     129,
  224.     ""
  225. };
  226.  
  227. resource 'DLOG' (131) {
  228.     {40, 40, 198, 474},
  229.     dBoxProc,
  230.     invisible,
  231.     noGoAway,
  232.     0x0,
  233.     131,
  234.     ""
  235. };
  236.  
  237. resource 'MBAR' (128) {
  238.     {    /* array MenuArray: 4 elements */
  239.         /* [1] */
  240.         128,
  241.         /* [2] */
  242.         129,
  243.         /* [3] */
  244.         130,
  245.         /* [4] */
  246.         131
  247.     }
  248. };
  249.  
  250. resource 'WIND' (128, purgeable) {
  251.     {38, 0, 340, 512},
  252.     documentProc,
  253.     visible,
  254.     noGoAway,
  255.     0x0,
  256.     "FinderOpenSel"
  257. };
  258.  
  259. resource 'SIZE' (-1) {
  260.     reserved,
  261.     acceptSuspendResumeEvents,
  262.     reserved,
  263.     canBackground,
  264.     multiFinderAware,
  265.     backgroundAndForeground,
  266.     dontGetFrontClicks,
  267.     ignoreChildDiedEvents,
  268.     is32BitCompatible,
  269.     isHighLevelEventAware,
  270.     localAndRemoteHLEvents,
  271.     notStationeryAware,
  272.     dontUseTextEditServices,
  273.     reserved,
  274.     reserved,
  275.     reserved,
  276.     100000,
  277.     100000
  278. };
  279.  
  280. resource 'STR ' (128) {
  281.     "Simple Help..."
  282. };
  283.  
  284. data 'TEXT' (128) {
  285.     $"5468 6973 2073 616D 706C 6520 7365 6E64"            /* This sample send */
  286.     $"7320 4669 6E64 6572 2027 4F70 656E 2053"            /* s Finder 'Open S */
  287.     $"656C 6563 7469 6F6E 2720 6576 656E 7473"            /* election' events */
  288.     $"2E0D 5468 6572 6520 6172 6520 7468 7265"            /* .¬There are thre */
  289.     $"6520 6D65 6E75 2069 7465 6D73 2075 6E64"            /* e menu items und */
  290.     $"6572 2074 6865 2054 6573 7420 5374 7566"            /* er the Test Stuf */
  291.     $"6620 6D65 6E75 2066 6F72 2079 6F75 2074"            /* f menu for you t */
  292.     $"6F20 6578 7065 7269 6D65 6E74 2077 6974"            /* o experiment wit */
  293.     $"682E 0D54 6865 2066 7273 7420 6F6E 652C"            /* h.¬The frst one, */
  294.     $"2027 4C61 756E 6368 2061 206C 6F63 616C"            /*  'Launch a local */
  295.     $"2066 696C 6527 2C20 7769 6C6C 2073 656E"            /*  file', will sen */
  296.     $"6420 616E 204F 7065 6E20 5365 6C65 6374"            /* d an Open Select */
  297.     $"696F 6E20 6576 656E 7420 746F 2074 6865"            /* ion event to the */
  298.     $"2046 696E 6465 7220 666F 7220 7468 6520"            /*  Finder for the  */
  299.     $"6669 6C65 2079 6F75 2073 656C 6563 7420"            /* file you select  */
  300.     $"696E 2074 6865 2053 7461 6E64 6172 6420"            /* in the Standard  */
  301.     $"4669 6C65 2062 6F78 2074 6861 7420 7769"            /* File box that wi */
  302.     $"6C6C 2061 7070 6561 722E 2020 5468 6973"            /* ll appear.  This */
  303.     $"2069 7320 7468 6520 6576 656E 7420 7374"            /*  is the event st */
  304.     $"796C 6520 796F 7527 6C6C 2075 7365 2066"            /* yle you'll use f */
  305.     $"6F72 2020 6C61 756E 6368 696E 6720 6170"            /* or  launching ap */
  306.     $"706C 6963 6174 696F 6E73 2C20 6F72 2073"            /* plications, or s */
  307.     $"696D 756C 6174 696E 6720 6120 646F 6375"            /* imulating a docu */
  308.     $"6D65 6E74 2069 636F 6E20 6265 696E 6720"            /* ment icon being  */
  309.     $"7365 6C65 6374 6564 2061 6E64 2027 4F70"            /* selected and 'Op */
  310.     $"656E 2720 6265 696E 6720 7365 6C65 6374"            /* en' being select */
  311.     $"6564 2066 726F 6D20 7468 6520 4669 6E64"            /* ed from the Find */
  312.     $"6572 2046 696C 6520 6D65 6E75 2E20 2054"            /* er File menu.  T */
  313.     $"6869 7320 6576 656E 7420 7769 6C6C 206E"            /* his event will n */
  314.     $"6F74 2063 6861 6E67 6520 616E 7920 4669"            /* ot change any Fi */
  315.     $"6E64 6572 2077 696E 646F 7773 2E0D 5468"            /* nder windows.¬Th */
  316.     $"6520 7365 636F 6E64 2073 656C 6563 7469"            /* e second selecti */
  317.     $"6F6E 2027 4F70 656E 2061 206C 6F63 616C"            /* on 'Open a local */
  318.     $"2046 696E 6465 7220 7769 6E64 6F77 2720"            /*  Finder window'  */
  319.     $"7769 6C6C 206E 6F74 2061 6374 7561 6C6C"            /* will not actuall */
  320.     $"7920 6F70 656E 2061 6E20 6170 706C 6963"            /* y open an applic */
  321.     $"6174 696F 6E20 6F72 2064 6F63 756D 656E"            /* ation or documen */
  322.     $"742C 2069 6E73 7465 6164 2069 7420 7769"            /* t, instead it wi */
  323.     $"6C6C 206F 7065 6E20 7468 6520 4669 6E64"            /* ll open the Find */
  324.     $"6572 2077 696E 646F 7720 636F 6E74 6169"            /* er window contai */
  325.     $"6E69 6E67 2074 6865 2066 696C 6520 796F"            /* ning the file yo */
  326.     $"7520 6368 6F6F 7365 2069 6E20 7468 6520"            /* u choose in the  */
  327.     $"5374 616E 6461 7264 2046 696C 6520 626F"            /* Standard File bo */
  328.     $"782E 200D 5468 6520 7468 6972 642C 274C"            /* x. ¬The third,'L */
  329.     $"6175 6E63 6820 6120 7265 6D6F 7465 2066"            /* aunch a remote f */
  330.     $"696C 6527 2C20 616C 6C6F 7773 2079 6F75"            /* ile', allows you */
  331.     $"2074 6F20 6C61 756E 6368 2061 2061 7070"            /*  to launch a app */
  332.     $"6C69 6361 7469 6F6E 206F 7220 646F 6375"            /* lication or docu */
  333.     $"6D65 6E74 206F 6E20 736F 6D65 206F 6E65"            /* ment on some one */
  334.     $"2065 6C73 6527 7320 6D61 6368 696E 652E"            /*  else's machine. */
  335.     $"0D59 6F75 276C 6C20 6265 2070 726F 6D70"            /* ¬You'll be promp */
  336.     $"7465 6420 666F 7220 7468 6520 6675 6C6C"            /* ted for the full */
  337.     $"2070 6174 6820 6E61 6D65 206F 6620 7468"            /*  path name of th */
  338.     $"6520 6669 6C65 2C20 616E 6420 7468 656E"            /* e file, and then */
  339.     $"2061 736B 6564 2074 6F20 6272 6F77 7365"            /*  asked to browse */
  340.     $"2066 6F72 2074 6865 2046 696E 6465 7220"            /*  for the Finder  */
  341.     $"6F6E 2074 6865 206D 6163 6869 6E65 2079"            /* on the machine y */
  342.     $"6F75 2077 6973 6820 746F 206C 6175 6E63"            /* ou wish to launc */
  343.     $"6820 7468 6520 6170 7020 6F6E 2E0D 4173"            /* h the app on.¬As */
  344.     $"206C 6F6E 6720 6173 2079 6F75 206B 6E6F"            /*  long as you kno */
  345.     $"7720 7468 6520 6675 6C6C 2070 6174 682C"            /* w the full path, */
  346.     $"2061 6E64 2063 616E 2050 726F 6772 616D"            /*  and can Program */
  347.     $"204C 696E 6B20 2867 7565 7374 206F 7220"            /*  Link (guest or  */
  348.     $"6675 6C6C 7920 7175 616C 6966 6965 6429"            /* fully qualified) */
  349.     $"2074 6865 2061 7070 6C69 6361 7469 6F6E"            /*  the application */
  350.     $"2077 696C 6C20 6C61 756E 6368 206F 6E20"            /*  will launch on  */
  351.     $"7468 6520 6F74 6865 7220 6D61 6368 696E"            /* the other machin */
  352.     $"652E"                                               /* e. */
  353. };
  354.  
  355. resource 'STR#' (128) {
  356.     {    /* array StringArray: 2 elements */
  357.         /* [1] */
  358.         "Select a machine and Finder",
  359.         /* [2] */
  360.         "This Finder"
  361.     }
  362. };
  363.  
  364. data 'vers' (1) {
  365.     $"0101 8000 0000 0531 2E30 2E31 4476 2031"            /* ..Ä....1.0.1Dv 1 */
  366.     $"2E30 2E31 2C20 A920 3139 3931 2D31 3939"            /* .0.1, © 1991-199 */
  367.     $"3220 4170 706C 6520 436F 6D70 7574 6572"            /* 2 Apple Computer */
  368.     $"2049 6E63 2E20 2053 6372 6177 6C65 6420"            /*  Inc.  Scrawled  */
  369.     $"6279 2043 2E4B 2E20 4861 756E 203C 5452"            /* by C.K. Haun <TR */
  370.     $"3E"                                                 /* > */
  371. };
  372.  
  373. data 'vers' (2) {
  374.     $"0101 8000 0000 0531 2E30 2E31 0776 2031"            /* ..Ä....1.0.1.v 1 */
  375.     $"2E30 2E31"                                          /* .0.1 */
  376. };
  377.  
  378. resource 'ICON' (129) {
  379.     $"0007 F000 001C 1C00 0030 0600 0040 0900"
  380.     $"0EAC CC80 09A9 B7C0 0D6D 3570 1F00 0170"
  381.     $"1200 0030 127C 3E2C 3C0C B01F 2405 2018"
  382.     $"6401 0018 7402 0036 140E 0032 3C18 0032"
  383.     $"2C1F C011 2C00 0019 2455 541F 4655 543C"
  384.     $"4640 0434 2B5F FC76 1940 0456 19D5 54D4"
  385.     $"18D5 55B2 1C55 5512 3875 5612 785D 5C11"
  386.     $"D857 F40D A854 5405 B850 1404 F040 0404"
  387. };
  388.  
  389.